;(function(){
var BusCon = require("../../core/bus/_con");
var db = require("../../core/db/index");
var config = require("../../core/_include/config");
var ResponObj = require("../_include/responObj");
var BuffCon = require("../../core/buff/_con");
var myfs = require("../_include/fs");
var theme = require("./theme");
var role = require("./role");
module.exports = {
	prefix:"/bus/user_bind",
	get:{
		"/":function () {
			var bus = role.getBus(this);
			var query = this.request.query;
			var result = bus.getAccUsers(query.num,query.page);
			this.body = ResponObj("json",result);
		},
		"/recommend_buff":function () {
			var bus = role.getBus(this);
			var result = bus.getRecommendBuffs();
			this.body = ResponObj("json",result);
		}
	},
	put:{
		"/cash_to_acc/set/discount":function () {
			var bus = role.getBus(this);
			var body = this.request.body;
			bus.clearRecommendBuff();
			var result = bus.addDiscountRecommendBuff(body);
			this.body = ResponObj("json",bus.getRecommendBuffs());
		},
		"/state/shenqingduihuanzhong_to_shangjiayijingfukuan":function () {
			var bus = role.getBus(this);
			var user_id = this.request.body.user_id;
			if (!user_id) {
				throwCusError("参数错误")
			}
			var bus_user_bind = bus.state_shenqingduihuanzhong_to_shangjiayijingfukuan(user_id);
			this.body = ResponObj("json",bus_user_bind);
		}
	}
}	
}());